package com.example.domain.enums;

/**
 * @author hlc
 * @version 1.0
 * @date 2022/10/12 8:27
 */
public enum AppHttpCodeEnum {
    /**
     * 状态码及提示信息
     */
    SUCCESS(200, "操作成功"),
    VERIFICATION_CODE_SEND_SUCCESS(200, "验证码发送成功"),
    NEED_LOGIN(401, "需要登录后操作"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    SYSTEM_ERROR(500, "系统错误"),
    USERNAME_EXIST(501, "用户名已存在"),
    NICKNAME_EXIST(502, "昵称已存在"),
    PHONE_NUMBER_EXIST(503, "手机号已存在"),
    EMAIL_EXIST(504, "邮箱已存在"),
    REQUIRE_USERNAME(505, "必需填写用户名"),
    LOGIN_ERROR(506, "用户名或密码错误"),
    CONTENT_NOT_NULL(507, "评论内容不能为空"),
    FILE_TYPE_ERROR(508, "文件类型错误"),
    USERNAME_NOT_NULL(509, "用户名不能为空"),
    PASSWORD_NOT_NULL(510, "密码不能为空"),
    NICKNAME_NOT_NULL(511, "昵称不能为空"),
    EMAIL_NOT_NULL(512, "邮箱不能为空"),
    VERIFICATION_CODE_OVERDUE(513, "验证码过期"),
    VERIFICATION_CODE_ERROR(514, "验证码错误"),
    USER_NOT_EXIST(515, "用户不存在"),
    ILLEGAL_DATA(516, "非法数据"),
    OPERATE_FREQUENTLY(517, "操作频繁");

    final int code;
    final String msg;

    AppHttpCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
